#include "player.h"
#include "strategy/prob_strategy.h"
#include "strategy/strategy.h"
#include "strategy/winning_strategy.h"
#include <iostream>

int main()
{
    Strategy *normal_strategy = new WinningStrategy();
    Player p1("Akassaki", normal_strategy);

    Strategy *rate_strategy = new ProbStrategy();
    Player p2("Kangtao", rate_strategy);

    for (int i = 0; i < 100; i++)
    {
        Hand *nextHand1 = p1.nextHand();
        Hand *nextHand2 = p2.nextHand();

        if (nextHand1->isStringerThan(nextHand2))
        {
            std::cout << "*Round " << i << ":\n" << "  Winner: " << "p1\n" << std::endl;
            p1.win();
            p2.lose();
        }
        else if (nextHand2->isStringerThan(nextHand1))
        {
            std::cout << "*Round " << i << ":\n" << "  Winner: " << "p2\n" << std::endl;
            p1.lose();
            p2.win();
        }
        else
        {
            std::cout << "*Round " << i << ":\n" << "Even\n" << std::endl;
            p1.even();
            p2.even();
        }
    }

    std::cout << "total result: " << std::endl;
    std::cout << p1.toString() << std::endl;
    std::cout << p2.toString() << std::endl;

    delete normal_strategy;
    delete rate_strategy;
    return 0;
}
